<?php //echo '<pre>';die(print_r($data));?>
<div class="breadcrumbwidget">
	<ul class="skins">
        <li><a href="default" class="skin-color default"></a></li>
        <li><a href="orange" class="skin-color orange"></a></li>
        <li>&nbsp;</li>
        <li class="fixed"><a href="" class="skin-layout fixed"></a></li>
        <li class="wide"><a href="" class="skin-layout wide"></a></li>
    </ul><!--skins-->
	<ul class="breadcrumb">
        <li><a href="<?php echo $baseurl?>">Trang chủ</a> <span class="divider">/</span></li>
        <li class="active">Danh sách nhà hàng</li>
    </ul>
</div><!--breadcrumbwidget-->
<div class="pagetitle">
	<h1>Quản lý danh sách nhà hàng</h1> <span></span>
</div>
<div class="maincontent">
    <div class="contentinner">    
    
        <?php $attr = array('class' => 'stdform','id' => 'form-list'); echo form_open('', $attr);?>
        <div id="dyntable_length" class="dataTables_length  content-dashboard">
        <input type="hidden" name="check-delete" value="1" />
        
            <a href="<?php echo $baseurl.'manage/restaurant/add-restaurant'?>" class="btn"><i class="icon-plus"></i> Thêm mới</a>
            <button class="btn" type="button" onclick="deleteall()"><i class="icon-remove"></i> Xóa đã chọn</button>
        </div>
    	<table class="table table-bordered">
            <colgroup>
                <col class="con0" />
                <col class="con1" />
                <col class="con0" />
                <col class="con1" />
                <col class="con0" />
            </colgroup>
            <thead>
                <tr>
                	<th class="centeralign" style="width: 5%;"><input type="checkbox" class="checkall" /></th>
                    <!-- <th style="width: 8%;">STT</th> -->
                    <th>Tên nhà hàng</th>
                    <th>Khu vực - thành phố</th>
                    <th>Danh mục</th>
					<th>Đánh giá</th>
                    <th class="centeralign" style="width: 10%">Tác vụ</th>
                </tr>
            </thead>
            <tbody>
            <?php if(!in_array($data, array(null, '', '0'))):?>
            <?php foreach($data AS $el=>$le):?>
                <tr>
                	<td class="centeralign"><input name="checkboxs[]" id="<?php echo $le->id?>" type="checkbox" value="<?php echo $le->id?>" /></td>
                    <!-- <td>1</td> -->
                    <td><?php echo $le->name?></td>
                    <td>
                        <?php if(!in_array($le->zone, array(null, '', '0'))):?>
                            <?php $c = sizeof($le->zone); $s = 0; foreach($le->zone AS $ell=>$lle):?>
                            <a>
                                <?php echo $lle->title?>
                            </a>
                            <?php $s++; if($s < $c){echo ', ';}?>
                            <?php endforeach;?>
                        <?php endif;?>
                    </td>
                    <td>
                        <?php if(!in_array($le->categories, array(null, '', '0'))):?>
                            <?php $cs = sizeof($le->zone); $ss = 0;  foreach($le->categories AS $ell=>$lle):?>
                            <a>
                                <?php echo $lle->title?>
                            </a>
                            <?php $ss++; if($ss < $cs){echo ', ';}?>
                            <?php endforeach;?>
                        <?php endif;?>
                    </td>
					 <td>
					  <?php echo $le->review ? $le->review : 'Đang cập nhật';?>
					 </td>
                    <td class="centeralign">
                        <a href="<?php echo $baseurl.'manage/restaurant/edit-restaurant/'.$le->id?>" class=""><span class="icon-edit"></span></a>
                        <a href="<?php echo $baseurl.'manage/restaurant/delete-restaurant/'.$le->id?>" class="delete-a"><span class="icon-trash"></span></a>   
                    </td>
                </tr>
            <?php endforeach;?>
            <?php endif?>
            </tbody>
        </table>
        <div class="dataTables_info" id="dyntable_info">
        
        </div>
        </form>
    </div>
</div>
